package com.monitor.search;

import com.monitor.model.Rights;
import com.monitor.pubInter.BaseSearch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
/**
*   @author afeng
*   @Date 2025-03-17 10:50:14
*   @description RightsSearch      权限表
*/


@Data
@ApiModel("权限表RightsSearch")
public abstract class RightsSearch<Sub extends RightsSearch<Sub>> extends BaseSearch {
    @ApiModelProperty(value = "主键")
    private List idIn;
    @ApiModelProperty(value = "名称")
    private String nameLike;
    @ApiModelProperty(value = "路由")
    private String valueLike;
    @ApiModelProperty(value = "上级ID")
    private String upIdEq;
    @ApiModelProperty(value = "大于同级排序")
    private Integer orderNumGreater;
    @ApiModelProperty(value = "小于同级排序")
    private Integer orderNumLess;
    @ApiModelProperty(value = "类型 1:顶部:TOP,2:左侧:LEFT,3:按钮:BUTTON")
    private List menuFlagIn;
    @ApiModelProperty(value = "后端接口")
    private String apiPathLike;
    @ApiModelProperty(value = "大于排序")
    private Integer sortNumGreater;
    @ApiModelProperty(value = "小于排序")
    private Integer sortNumLess;
    @ApiModelProperty(value = "是否显示 1:是:Y,0:否:N")
    private List showFlagIn;
    @ApiModelProperty(value = "是否删除 1:删除:Y,0:正常:N")
    private Integer delFlagEq=0;
    @ApiModelProperty(value = "大于级别")
    private Integer levelGreater;
    @ApiModelProperty(value = "小于级别")
    private Integer levelLess;

    public RightsSearch() {
        setDelFlagEq(0);
    }



    /**
    * 返回子类Sub
    * @return
    */
    public abstract Sub getSubThis();

    @Override
    public String createTimeFiled() {
        return Rights.CREATE_TIME;
    }
    @Override
    public String updateTimeFiled() {
        return Rights.UPDATE_TIME;
    }
    @Override
    public String  setDefaultField() {
        return Rights.CREATE_TIME;
    }
    @Override
    public String pkField() {
        return Rights.ID;
    }

    @Override
    public String  toString() {
        return "RightsSearch{}"+super.toString();
    }
    public Sub setIdIn(List idIn){
        this.idIn = idIn;
        setInField(Rights.ID, idIn);
        return getSubThis();
    }
    public Sub setNameLike(String nameLike){
        this.nameLike = nameLike;
        setLikeField(Rights.NAME, nameLike);
        return getSubThis();
    }
    public Sub setValueLike(String valueLike){
        this.valueLike = valueLike;
        setLikeField(Rights.VALUE, valueLike);
        return getSubThis();
    }
    public Sub setUpIdEq(String upIdEq){
        this.upIdEq = upIdEq;
        setEqualField(Rights.UP_ID, upIdEq);
        return getSubThis();
    }
    public Sub setOrderNumGreater(Integer orderNumGreater){
        this.orderNumGreater = orderNumGreater;
        setGreaterField(Rights.ORDER_NUM, orderNumGreater);
        return getSubThis();
    }
    public Sub setOrderNumLess(Integer orderNumLess){
        this.orderNumLess = orderNumLess;
        setLessField(Rights.ORDER_NUM, orderNumLess);
        return getSubThis();
    }
    public Sub setMenuFlagIn(List menuFlagIn){
        this.menuFlagIn = menuFlagIn;
        setInField(Rights.MENU_FLAG, menuFlagIn);
        return getSubThis();
    }
    public Sub setApiPathLike(String apiPathLike){
        this.apiPathLike = apiPathLike;
        setLikeField(Rights.API_PATH, apiPathLike);
        return getSubThis();
    }
    public Sub setSortNumGreater(Integer sortNumGreater){
        this.sortNumGreater = sortNumGreater;
        setGreaterField(Rights.SORT_NUM, sortNumGreater);
        return getSubThis();
    }
    public Sub setSortNumLess(Integer sortNumLess){
        this.sortNumLess = sortNumLess;
        setLessField(Rights.SORT_NUM, sortNumLess);
        return getSubThis();
    }
    public Sub setShowFlagIn(List showFlagIn){
        this.showFlagIn = showFlagIn;
        setInField(Rights.SHOW_FLAG, showFlagIn);
        return getSubThis();
    }
    public Sub setDelFlagEq(Integer delFlagEq){
        this.delFlagEq = delFlagEq;
        setEqualField(Rights.DEL_FLAG, String.valueOf(delFlagEq));
        return getSubThis();
    }
    public Sub setLevelGreater(Integer levelGreater){
        this.levelGreater = levelGreater;
        setGreaterField(Rights.LEVEL, levelGreater);
        return getSubThis();
    }
    public Sub setLevelLess(Integer levelLess){
        this.levelLess = levelLess;
        setLessField(Rights.LEVEL, levelLess);
        return getSubThis();
    }
}